////////////////////////////////////////////////////////////////////////////////
//(c) Intelliquip, Inc. 2001
////////////////////////////////////////////////////////////////////////////////
//$Log:
// 3    Version 10.0 (Current View)1.2         10/19/2010 2:26:16 PM  Stephen
//      Kish    IDD#6245: Refactoring HttpSessions.get and set Attribute to use
//      DAO classes
// 2    Version 10.0 (Current View)1.1         10/7/2010 4:51:55 PM   Jeff
//      Heigl      IDD#9126: new item servlet cleanup
// 1    Version 10.0 (Current View)1.0         11/24/2009 10:56:54 AM Jeff
//      Heigl      
//$
//$NoKeywords$
////////////////////////////////////////////////////////////////////////////////
package com.intelliquip.hydraulicselection.control.web;

import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.TreeMap;

import javax.servlet.http.HttpSession;

import com.intelliquip.chart.NewOutputChart;
import com.intelliquip.core.TransportLogBean;
import com.intelliquip.core.servlet.SessionTracker;
import com.intelliquip.core.servlet.dao.HttpSessionAttributeDAO_Core;
import com.intelliquip.hydraulicselection.UserPreferences;
import com.intelliquip.hydraulicselection.productline.web.ProductLineWebImpl;

/**
 *  Data Access Object (DAO) for accessing HTTP session attributes that's used within the Selector project.
 *  <br/>
 *  This is an implementation of {@link SessionAttributeDAO_Selector} using {@link HttpSession}
 */
public class HttpSessionAttributeDAO_Selector extends HttpSessionAttributeDAO_Core implements SessionAttributeDAO_Selector {

	// If you extend this class to access additional attributes, please define
	// the String-ID here, and not in the methods themselves, so they are easier
	// to maintain.
	private static final String TRANPORT_LOG = "transportLog";
	private static final String USER_PREFERENCES = "userPreferences";
	private static final String PRODUCT_LINE_WEB = "productLineWeb";
	private static final String PUMP_DETAILS_TEMP_KEY_MAP = "pumpDetailsTempKeyMap";
	private static final String PUMP_DETAILS_HASH = "PumpDetailsHash";
	private static final String SELECTED_URL = "selectedURL";
	private static final String CURRENT_SCREEN = "currentScreen";
	private static final String STYLE_SHEET_IEQ = "styleSheetIEQ";
	private static final String VERTICAL_PRODUCTLINE_SELECTED = "verticalProductlineSelected";
	private static final String DENSITY_VALIDATION_FAILED = "densityValidationFailed";
	private static final String SET_MULTI_SPEED_FROM_LCC = "setMultiSpeedFromLCC";
	private static final String  ALL_THUMBNAILS_IMPLICITLY_SELECTED= "allThumbnailsImplicitlySelected";
	private static final String SESSION_TRACKER = "sessionTracker";
	private static final String NEW_CHART = "newchart";
	private static final String IEQ_USER_ID = "ieq_userid";
	private static final String ALERT_VECTOR = "alertMessageVector";
	private static final String COMPRESSOR_DATASHEET_CHART = "compressorDatasheetChart";
	private static final String COMPRESSOR_PARALLEL_POWER_CHART = "compressorParallelPowerChart";
	private static final String RETURN_TARGET = "returnTarget";

	public HttpSessionAttributeDAO_Selector(HttpSession session) {
		super(session);
	}
	
	public void setTransportLog(TransportLogBean tLog) {
		setAttribute(TRANPORT_LOG, tLog);
	}
	
	public TransportLogBean getTransportLog() {
		return (TransportLogBean) getAttribute(TRANPORT_LOG);
	}
	
	public void setUserPreferences(UserPreferences userPreferences) {
		setAttribute(USER_PREFERENCES, userPreferences);
	}
	
	public UserPreferences getUserPreferences() {
		return (UserPreferences) getAttribute(USER_PREFERENCES);
	}

	public ProductLineWebImpl getProductLineWeb() {
		return (ProductLineWebImpl) getAttribute(PRODUCT_LINE_WEB);
	}

	public void setProductLineWeb(ProductLineWebImpl productLineWeb) {
		setAttribute(PRODUCT_LINE_WEB, productLineWeb);
	}

	public TreeMap getPumpDetailsKeyMap() {
		return (TreeMap) getAttribute(PUMP_DETAILS_TEMP_KEY_MAP);
	}

	public void setPumpDetailsKeyMap(TreeMap pumpDetailsTreeMap) {
		setAttribute(PUMP_DETAILS_TEMP_KEY_MAP, pumpDetailsTreeMap);
	}
	
	public HashMap getPumpDetailsHash() {
		return (HashMap) getAttribute(PUMP_DETAILS_HASH);
	}

	public void setPumpDetailsHash(HashMap pumpDetailsHash) {
		setAttribute(PUMP_DETAILS_HASH, pumpDetailsHash);
	}
	
	public String getSelectedURL() {
		return (String) getAttribute(SELECTED_URL);
	}

	public void setSelectedURL(String selectedURL) {
		setAttribute(SELECTED_URL, selectedURL);
	}

	public int getCurrentScreen() {
		return ((Integer)getAttribute(CURRENT_SCREEN)).intValue();
	}

	public void setCurrentScreen(int currentScreen) {
		setAttribute(CURRENT_SCREEN, currentScreen);
	}

	public String getStyleSheetIEQ() {
		return (String)getAttribute(STYLE_SHEET_IEQ);
	}
	
	public void setStyleSheetIEQ(String styleSheetIEQ) {
		setAttribute(STYLE_SHEET_IEQ, styleSheetIEQ);
	}

	public boolean getVerticalProductLineSelected() {
		return Boolean.valueOf(String.valueOf(getAttribute(VERTICAL_PRODUCTLINE_SELECTED)));
	}

	public void setVerticalProductLineSelected(boolean verticalProductLineSelected) {
		setAttribute(VERTICAL_PRODUCTLINE_SELECTED, verticalProductLineSelected);
	}
	
	public boolean getDensityValidationFailed() {
		return Boolean.valueOf(String.valueOf(getAttribute(DENSITY_VALIDATION_FAILED)));
	}

	public void setDensityValidationFailed(boolean densityValidationFailed) {
		setAttribute(DENSITY_VALIDATION_FAILED, densityValidationFailed);
	}
	
	public String getMultiSpeedFromLCC() {
		return (String)getAttribute(SET_MULTI_SPEED_FROM_LCC);
	}

	public void setMultiSpeedFromLCC(String multiSpeedFromLCC) {
		setAttribute(SET_MULTI_SPEED_FROM_LCC, multiSpeedFromLCC);
	}

	public String getAllThumbnailsImplicitlySelected() {
		return (String)getAttribute(ALL_THUMBNAILS_IMPLICITLY_SELECTED);
	}

	public void setAllThumbnailsImplicitlySelected(String allThumbnailsImplicitlySelected) {
		setAttribute(ALL_THUMBNAILS_IMPLICITLY_SELECTED, allThumbnailsImplicitlySelected);
	}
	
	public SessionTracker getSessionTracker() {
		return (SessionTracker)getAttribute(SESSION_TRACKER);
	}

	public void setSessionTracker(SessionTracker sessionTracker) {
		setAttribute(SESSION_TRACKER, sessionTracker);
	}

	public NewOutputChart getOutputChart(String chartKey) {
		return (NewOutputChart)getAttribute(chartKey);
	}

	public void setOutputChart(String chartKey, NewOutputChart outputChart) {
		setAttribute(chartKey, outputChart);
	}

	@Override
	public Map<String, NewOutputChart> getNewChart() {
		return (Map<String, NewOutputChart>)getAttribute(NEW_CHART);
	}

	@Override
	public void setNewChart(Map<String, NewOutputChart> newChart) {
		setAttribute(NEW_CHART, newChart);
	}
	
	@Override
	public String getIeqUserID() {
		return (String)getAttribute(IEQ_USER_ID);
	}

	@Override
	public void setIeqUserID(String ieqUserID) {
		setAttribute(IEQ_USER_ID, ieqUserID);
	}
	
	@Override
	public List<String> getAlertVector() {
		return (List<String>)getAttribute(ALERT_VECTOR);
	}

	@Override
	public void setAlertVector(List<String> alertVector) {
		setAttribute(ALERT_VECTOR, alertVector);
	}
	
	@Override
	public NewOutputChart getCompressorDatasheetChart() {
		return (NewOutputChart)getAttribute(COMPRESSOR_DATASHEET_CHART);
	}

	@Override
	public void setCompressorDatasheetChart(NewOutputChart chart) {
		setAttribute(COMPRESSOR_DATASHEET_CHART, chart);
	}
	
	@Override
	public NewOutputChart getCompressorParallelPowerChart() {
		return (NewOutputChart)getAttribute(COMPRESSOR_PARALLEL_POWER_CHART);
	}

	@Override
	public void setCompressorParallelPowerChart(NewOutputChart chart) {
		setAttribute(COMPRESSOR_PARALLEL_POWER_CHART, chart);
	}
	
	@Override
	public String getReturnTarget() {
		return (String)getAttribute(RETURN_TARGET);
	}

	@Override
	public void setReturnTarget(String target) {
		setAttribute(RETURN_TARGET, target);
	}
}
